package com.kilomob.grady.spring;

import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;

import com.kilomob.grady.server.netty.NettyServer;

/**
 * 
 * registory解析类
 * 
 *   
 * @author zhouzhixiang  
 * @date 2016年12月31日 
 * @since 1.0
 */
public class ServerBean implements InitializingBean, DisposableBean {
    private String id;
    private int port;
    private String name;
    private String protocol;
    
    public void destroy() throws Exception {
    }

    public void afterPropertiesSet() throws Exception {
        NettyServer server = new NettyServer();
        server.setPort(port);
        server.setName(name);
        server.setId(id);
        server.start();
    }
    
    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getProtocol() {
        return protocol;
    }

    public void setProtocol(String protocol) {
        this.protocol = protocol;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }
    
}


